import pyperclip
import time
# import re
# patter = re.compile(r'( )*')

while True:
    text = pyperclip.paste()
    pyperclip.copy(text)
    # pyperclip.copy(patter.sub('\g<1>', text).strip())

    while True:
        cur_text = pyperclip.paste()
        pyperclip.copy(cur_text)
        if cur_text != text:
        #     if patter.search(cur_text):
        #         pyperclip.copy(patter.sub('\g<1>', cur_text).strip())
        #     else:
        #         pyperclip.copy(cur_text)
        #     break
            pyperclip.copy(cur_text)
            break
        time.sleep(0.1)
